<extend name="template/base_index" />

<block name="area_header">
    <link rel="stylesheet" type="text/css" media="all" href="__CSS__/wxshop.css">
    <link type="text/css" rel="stylesheet" src="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
    <script src="__CDN__/jquery-cookie/1.4.1/jquery.cookie.js"></script>

</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <!-- 过滤\查询按钮 -->
            <div class="filter-controls">
                <!-- 日期查询 -->
                <form action="{:U('Admin/QueryTableInfo/testzjport')}" method="post" class="form-inline">
                    <div class="form-group">
                        <label>api_uri过滤条件</label>
                        <input type="text" name="filter" class="form-control input-sm" value="{$filter}" placeholder="请输入过滤条件" />
                    </div>
                    <button type="submit" class="btn btn-default btn-sm" id="searchFormSubmit"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
                    <button type="button" id="autoRefresh" class="btn btn-warning"><i class="fa fa-refresh"></i><span class="txt">停止刷新</span><span class="countdown"></span></button>

                </form>
            </div>
            <!-- 操作按钮 -->
            <div class="btn-controls">
            </div>


            <table class="table table-striped table table-hover  table-condensed">
                <thead>
                <tr>
                    <th>ID
                    </th>
                    <th>
                        时间
                    </th>
                    <th>
                        get参数
                    </th>
                    <th>
                        post参数
                    </th>
                    <th>
                        备注
                    </th>
                </tr>
                </thead>
                <tbody>
                <empty name="list">
                    <tr>
                        <td colspan="5" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    <else/>
                    <volist name="list" id="vo">
                        <tr>
                            <td>
                                {$vo.id}</td>
                            <td class="text-ellipsis">
                                {$vo.call_time|date='Y-m-d H:i:s',###}
                               </td>
                            <td>
                                {$vo.notes}
                            </td>
                            <td>
                                {:dump($vo['call_get_args'])}
                            </td>
                            <td>
                                {:dump($vo['call_post_args'])}
                            </td>
                        </tr>

                    </volist>
                </empty>
                </tbody>
            </table>
            <div>{$show}</div>

        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">
    <script type="text/javascript">
        function autoRefresh(){
            var refreshFlag = $.cookie('testzjport_autoRefresh');
            if(refreshFlag == "false"){
                return ;
            }
            $("#searchFormSubmit").click();
//            window.location.href = "__SELF__";
        }

        $(function(){
            $("#autoRefresh").click(function(){

                var refreshFlag = $.cookie('testzjport_autoRefresh');
                if(refreshFlag == "true"){
                    $.cookie("testzjport_autoRefresh","false");
                }else{
                    $.cookie("testzjport_autoRefresh","true");
                }

                autoRefresh();
            });
            var interval = setTimeout(function(){
                autoRefresh();
            },1000);
        })
    </script>
</block>